package com.hy.study.demo.complexquerydemo.bean.business;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.ArrayList;
import java.util.List;

public class OrganizationDTO {
	/**
	 * ID
	 */
	private String id;

	/**
	 * 管理上级ID
	 */
	private String managementSuperiorId;
	/**
	 * 管理下级
	 */
	private List<OrganizationDTO> managementSubordinates;

	/**
	 * 产权上级ID
	 */
	private String propertySuperiorId;
	/**
	 * 产权下级
	 */
	private List<OrganizationDTO> propertySubordinates;

	/**
	 * 工商注册信息
	 */
	private BusinessRegistrationInfo businessRegistrationInfo;

	/**
	 * 补充基本信息
	 */
	private SupplementedBasicInfo supplementedBasicInfo;

	/**
	 * 通讯信息
	 */
	private CommunicationInfo communicationInfo;

	/**
	 * 股票信息
	 */
	private StockInfo stockInfo;

	/**
	 * 集团内部管理信息
	 */
	private GroupInternalManagementInfo groupInternalManagementInfo;

	public OrganizationDTO() {
		this.businessRegistrationInfo = new BusinessRegistrationInfo();
		this.supplementedBasicInfo = new SupplementedBasicInfo();
		this.communicationInfo = new CommunicationInfo();
		this.stockInfo = new StockInfo();
		this.groupInternalManagementInfo = new GroupInternalManagementInfo();
		this.managementSubordinates = new ArrayList<>();
		this.propertySubordinates = new ArrayList<>();
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getManagementSuperiorId() {
		return managementSuperiorId;
	}

	public void setManagementSuperiorId(String managementSuperiorId) {
		this.managementSuperiorId = managementSuperiorId;
	}

	public List<OrganizationDTO> getManagementSubordinates() {
		return managementSubordinates;
	}

	public void setManagementSubordinates(List<OrganizationDTO> managementSubordinates) {
		this.managementSubordinates = managementSubordinates;
	}

	public String getPropertySuperiorId() {
		return propertySuperiorId;
	}

	public void setPropertySuperiorId(String propertySuperiorId) {
		this.propertySuperiorId = propertySuperiorId;
	}

	public List<OrganizationDTO> getPropertySubordinates() {
		return propertySubordinates;
	}

	public void setPropertySubordinates(List<OrganizationDTO> propertySubordinates) {
		this.propertySubordinates = propertySubordinates;
	}

	public BusinessRegistrationInfo getBusinessRegistrationInfo() {
		return businessRegistrationInfo;
	}

	public void setBusinessRegistrationInfo(BusinessRegistrationInfo businessRegistrationInfo) {
		this.businessRegistrationInfo = businessRegistrationInfo;
	}

	public SupplementedBasicInfo getSupplementedBasicInfo() {
		return supplementedBasicInfo;
	}

	public void setSupplementedBasicInfo(SupplementedBasicInfo supplementedBasicInfo) {
		this.supplementedBasicInfo = supplementedBasicInfo;
	}

	public CommunicationInfo getCommunicationInfo() {
		return communicationInfo;
	}

	public void setCommunicationInfo(CommunicationInfo communicationInfo) {
		this.communicationInfo = communicationInfo;
	}

	public StockInfo getStockInfo() {
		return stockInfo;
	}

	public void setStockInfo(StockInfo stockInfo) {
		this.stockInfo = stockInfo;
	}

	public GroupInternalManagementInfo getGroupInternalManagementInfo() {
		return groupInternalManagementInfo;
	}

	public void setGroupInternalManagementInfo(GroupInternalManagementInfo groupInternalManagementInfo) {
		this.groupInternalManagementInfo = groupInternalManagementInfo;
	}

	@Override
	public String toString() {
		ObjectMapper objectMapper = new ObjectMapper();
		try {
			return objectMapper.writeValueAsString(this);
		} catch (JsonProcessingException e) {
			return null;
		}
	}
}